package cn.wk.client;

import cn.wk.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserContextFactory implements FallbackFactory<UserContextClient>{
    @Override
    public UserContextClient create(Throwable throwable) {
        return new UserContextClient() {
            @Override
            public AjaxResult selectLogin(Long loginId) {
                throwable.printStackTrace();
                System.out.println("----------------system中的feign调用失败--------------------");
                return AjaxResult.me().setSuccess(false).setMessage("system中的feign调用失败");
            }
        };
    }
}
